﻿namespace MugenInjection.Delegates
{
    /// <summary>
    /// Encapsulates a method that has one parameter and returns a value of the type specified by the TResult parameter.
    /// </summary>
    /// <typeparam name="TResult"></typeparam>
    /// <returns></returns>
    public delegate TResult Func<out TResult>();

    /// <summary>
    /// Encapsulates a method that has one parameter and returns a value of the type specified by the TResult parameter.
    /// </summary>
    /// <typeparam name="TResult"></typeparam>
    /// <typeparam name="T1"> </typeparam>
    /// <returns></returns>
    public delegate TResult Func<in T1, out TResult>(T1 arg1);

    /// <summary>
    /// Encapsulates a method that has three parameters and returns a value of the type specified by the <paramref name="TResult"/> parameter.
    /// </summary>
    /// 
    /// <returns>
    /// The return value of the method that this delegate encapsulates.
    /// </returns>
    /// <param name="arg1">The first parameter of the method that this delegate encapsulates.</param><param name="arg2">The second parameter of the method that this delegate encapsulates.</param><param name="arg3">The third parameter of the method that this delegate encapsulates.</param><typeparam name="T1">The type of the first parameter of the method that this delegate encapsulates.</typeparam><typeparam name="T2">The type of the second parameter of the method that this delegate encapsulates.</typeparam><typeparam name="T3">The type of the third parameter of the method that this delegate encapsulates.</typeparam><typeparam name="TResult">The type of the return value of the method that this delegate encapsulates.</typeparam>
    public delegate TResult Func<in T1, in T2, out TResult>(T1 arg1, T2 arg2);

    /// <summary>
    /// Encapsulates a method that has three parameters and returns a value of the type specified by the <paramref name="TResult"/> parameter.
    /// </summary>
    /// 
    /// <returns>
    /// The return value of the method that this delegate encapsulates.
    /// </returns>
    /// <param name="arg1">The first parameter of the method that this delegate encapsulates.</param><param name="arg2">The second parameter of the method that this delegate encapsulates.</param><param name="arg3">The third parameter of the method that this delegate encapsulates.</param><typeparam name="T1">The type of the first parameter of the method that this delegate encapsulates.</typeparam><typeparam name="T2">The type of the second parameter of the method that this delegate encapsulates.</typeparam><typeparam name="T3">The type of the third parameter of the method that this delegate encapsulates.</typeparam><typeparam name="TResult">The type of the return value of the method that this delegate encapsulates.</typeparam>
    public delegate TResult Func<in T1, in T2, in T3, out TResult>(T1 arg1, T2 arg2, T3 arg3);

    /// <summary>
    /// Encapsulates a method that has two parameters and does not return a value.
    /// </summary>
    public delegate void Action();

    /// <summary>
    /// Encapsulates a method that has two parameters and does not return a value.
    /// </summary>
    /// <param name="arg1">The first parameter of the method that this delegate encapsulates.</param><param name="arg2">The second parameter of the method that this delegate encapsulates.</param><typeparam name="T1">The type of the first parameter of the method that this delegate encapsulates.This type parameter is contravariant. That is, you can use either the type you specified or any type that is less derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics.</typeparam><typeparam name="T2">The type of the second parameter of the method that this delegate encapsulates.</typeparam><filterpriority>2</filterpriority>
    public delegate void Action<in T1, in T2>(T1 arg1, T2 arg2);
}